<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!--资源获取-->
    <base th:href="|${#request.getContextPath()}/|">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="static/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--layui-->
    <link rel="stylesheet" type="text/css" href="static/layui/css/layui.css"/>
    <script type="text/javascript" src="static/layui/layui.js"></script>
    <title>资讯列表</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    首页
    <span class="c-gray en">&gt;</span>
    模拟投资
    <span class="c-gray en">&gt;</span>
    我的投资
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>

</nav>

<div class="layui-row">
    <fieldset class="layui-elem-field layui-field-title">
    <legend>我的投资</legend>
</fieldset>
</div>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <ul class="layui-tab-title">
        <li class="layui-this">投资明细</li>
        <li>投资情况</li>
    </ul>
    <div class="layui-tab-content" >
        <div class="layui-tab-item layui-show"><table class="layui-hide" id="demo2" lay-filter="test"></table></div>
        <div class="layui-tab-item"><table class="layui-hide" id="demo1" lay-filter="test"></table></div>
    </div>
</div>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">详细</a>
</script>
<script type="text/javascript" src="static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="static/my/js/post.js"></script>
<script type="text/javascript" src="static/my/js/util.js"></script>
<script>
    var dates;

    /*收藏按钮*/
    var ejhref = "Investment/adminHtml";//收藏路径
    var ejhrefname = "投资管理"
    ccscym(ejhref)
    $("#djsc").on("click", function () {
        scym(ejhref, ejhrefname)
    })
    /*收藏按钮*/


    layui.use(['layer', 'laydate','form','element'], function () {
        //得到各种内置组件
        var table = layui.table,
            form =layui.form,
            element = layui.element;

        //执行一个 table 实例
        table.render(
            {
            elem: '#demo2'
            ,id :"table2"
            , url: '/TouZi/selectTzmx' //数据接口
            , title: '投资明细表'
            , page: true //开启分页
            ,where:{
                "zqId": '[[${zqId}]]',
                    "uId":'[[${uId}]]'
            }
            , toolbar: true  //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
            , cols: [
                [ //表头

                    { field: 'lx', title: '类型',templet: function (res) {
                        switch (res.lb) {
                            case 1:
                                return '<em>股票</em>';
                                break;
                            case 2:
                                return '<em>基金</em>';
                                break;
                            case 3:
                                return '<em>黄金</em>';
                                break;
                            case 4:
                                return '<em>彩票</em>';
                                break;
                        }
                    }}
                    , {field: 'tzCode', title: '投资代码',sort: true}
                    , {field: 'tzAmount', title: '投资金额'}
                    , {field: 'reserve1', title: '措施', templet: function (res) {
                        if(res.reserve1 == 1){
                            return '<em>买入</em>';
                        }else  return '<em>卖出</em>';
                    }, sort: true}
                    , {field: 'startTime', title: '时间', width: 200}
                    , {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 100}
                ]
            ]

        });
        table.render(
            {
                elem: '#demo1'
                ,id :"table1"
                , url: '/TouZi/selectTzqk' //数据接口
                , title: '投资情况表'
                , page: true //开启分页
                ,where:{
                    "zqId": '[[${zqId}]]',
                    "uId":'[[${uId}]]'
                }
                , toolbar: true  //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
                , cols: [
                    [ //表头
                        { field: 'lx', title: '类型',templet: function (res) {
                                switch (res.lb) {
                                    case 1:
                                        return '<em>股票</em>';
                                        break;
                                    case 2:
                                        return '<em>基金</em>';
                                        break;
                                    case 3:
                                        return '<em>黄金</em>';
                                        break;
                                    case 4:
                                        return '<em>彩票</em>';
                                        break;
                                }
                            }}
                        , {field: 'tzCode', title: '投资代码',sort: true}
                        , {field: 'codeName', title: '投资名称',sort: true}
                        , {field: 'tzAmount', title: '投资总金额'}
                        , {field: 'tzFe', title: '份额', sort: true}
                        , {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 100}
                    ]
                ]

            }
        );

        //监听行工具事件
        table.on('tool(test)', function(obj){
            var data = obj.data;
            //console.log(obj)
             if(obj.event === 'edit'){
                 creatIframe("Investment/GoJdInvestment?code="+data.tzCode+"&lb="+data.lx,"常规投资")
            }
        });


    })


</script>

<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="static/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript">


</script>

</body>
</html>
